/**
 * Copyright 2005 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.edi.db;

import com.edi.db.table.FieldEntity;
import com.edi.db.table.TableEntity;
import com.edi.db.type.BigDecimalType;
import com.edi.db.type.BigIntegerType;
import com.edi.db.type.BinaryType;
import com.edi.db.type.BlobType;
import com.edi.db.type.BooleanType;
import com.edi.db.type.ByteType;
import com.edi.db.type.CalendarDateType;
import com.edi.db.type.CalendarType;
import com.edi.db.type.CharacterType;
import com.edi.db.type.ClobType;
import com.edi.db.type.CurrencyType;
import com.edi.db.type.DateType;
import com.edi.db.type.DoubleType;
import com.edi.db.type.FloatType;
import com.edi.db.type.IntegerType;
import com.edi.db.type.LongType;
import com.edi.db.type.NullableType;
import com.edi.db.type.ShortType;
import com.edi.db.type.StringType;
import com.edi.db.type.TextType;
import com.edi.db.type.TimeType;
import com.edi.db.type.TimestampType;
import com.edi.util.SqlTypeHelper;

public final class EdiDb {
	public static final NullableType BLOB = new BlobType();

	public static final NullableType CLOB = new ClobType();

	/**
	 * EdiDb <tt>long</tt> type.
	 */
	public static final NullableType LONG = new LongType();

	/**
	 * EdiDb <tt>short</tt> type.
	 */
	public static final NullableType SHORT = new ShortType();

	/**
	 * EdiDb <tt>integer</tt> type.
	 */
	public static final NullableType INTEGER = new IntegerType();

	/**
	 * EdiDb <tt>byte</tt> type.
	 */
	public static final NullableType BYTE = new ByteType();

	/**
	 * EdiDb <tt>float</tt> type.
	 */
	public static final NullableType FLOAT = new FloatType();

	/**
	 * EdiDb <tt>double</tt> type.
	 */
	public static final NullableType DOUBLE = new DoubleType();

	/**
	 * EdiDb <tt>character</tt> type.
	 */
	public static final NullableType CHARACTER = new CharacterType();

	/**
	 * EdiDb <tt>string</tt> type.
	 */
	public static final NullableType STRING = new StringType();

	/**
	 * EdiDb <tt>time</tt> type.
	 */
	public static final NullableType TIME = new TimeType();

	/**
	 * EdiDb <tt>date</tt> type.
	 */
	public static final NullableType DATE = new DateType();

	/**
	 * EdiDb <tt>timestamp</tt> type.
	 */
	public static final NullableType TIMESTAMP = new TimestampType();

	/**
	 * EdiDb <tt>boolean</tt> type.
	 */
	public static final NullableType BOOLEAN = new BooleanType();

	/**
	 * EdiDb <tt>big_decimal</tt> type.
	 */
	public static final NullableType BIG_DECIMAL = new BigDecimalType();

	/**
	 * EdiDb <tt>big_integer</tt> type.
	 */
	public static final NullableType BIG_INTEGER = new BigIntegerType();

	public static final NullableType CURRENCY = new CurrencyType();

	/**
	 * EdiDb <tt>binary</tt> type.
	 */
	public static final NullableType BINARY = new BinaryType();

	/**
	 * EdiDb <tt>text</tt> type.
	 */
	public static final NullableType TEXT = new TextType();

	/**
	 * EdiDb <tt>calendar</tt> type.
	 */
	public static final NullableType CALENDAR = new CalendarType();

	/**
	 * EdiDb <tt>calendar_date</tt> type.
	 */
	public static final NullableType VARBINARY = new BinaryType();

	public static final NullableType CALENDAR_DATE = new CalendarDateType();

	public static final String TYPE_BOOLEAN = "boolean";

	public static final String TYPE_STRING = "string";

	public static final String TYPE_INT = "int";

	public static final String TYPE_FLOAT = "float";

	public static final String TYPE_DECIMAL = "decimal";

	public static final String TYPE_IMAGE = "image";

	public static final String TYPE_DATE = "date";

	public static final String TYPE_CURRENCY = "currency";

	public static final String TYPE_TEXT = "text";

	public static final String DIALECT_MSSQL = "mssql";

	public static final String DIALECT_MYSQL = "mysql";

	public static final String DIALECT_ORACLE = "oracle";

	public static final String DIALECT_SQLITE = "sqlite";

	public static final String DIALECT_SYBASE = "sybase";

	public static final String DIALECT_IGNORECASE_TRUE = "true";

	public static final String DIALECT_IGNORECASE_FALSE = "false";

	public static final String TABLE_EDI_APPDES = "edi_appdes";

	public static final String TABLE_EDI_PARTDES = "edi_partdes";

	public static final String TABLE_EDI_WFLDES = "edi_wfldes";

	public static final String TABLE_EDI_PAGEDES = "edi_pagedes";

	public static final String TABLE_EDI_TABLEDES = "edi_tabledes";

	public static final String TABLE_EDI_BDDES = "edi_dbdes";

	public static final String TABLE_EDI_TBDESCRIBE = "edi_tbdescribe";

	public static final String TABLE_EDI_DESKTOP_MODULE = "edi_desktop_module";

	public static final String TABLE_EDI_DESKTOP_STYLE = "edi_desktop_style";

	public static final String TABLE_EDI_SERVICEDES = "edi_servicedes";

	public static final String TABLE_PERSON_SHORTCUT = "person_shortcut";

	public static final String TABLE_EDI_USER = "edi_user";

	public static final String TABLE_EDI_UNITUSER = "edi_unituser";

	public static final String TABLE_EDI_UNIT = "edi_unit";

	public static final String TABLE_EDI_ROLER = "edi_roler";

	public static final String TABLE_EDI_ROLERAPP = "edi_rolerapp";

	public static final String TABLE_ROLERAPP = "roler_app";

	public static final String TABLE_EDI_NETHdUSERCAPACITY = "EDI_NetHdUserCapacity";

	public static final String TABLE_EDI_NETHdFILES = "EDI_NetHdFiles";

	public static final String TABLE_EDI_ROLERUSER = "edi_roleruser";

	public static final String TABLE_APP_MOUDLE = "app_moudle";

	public static final String TABLE_APP_ROLER = "app_roler";

	public static final String TABLE_APP_ROLERMOUDLE = "app_rolermoudle";

	public static final String TABLE_APP_ROLERUSER = "app_roleruser";

	public static final String TABLE_WAP_APP_MOUDLE = "wapapp_moudle";

	public static final String TABLE_WAP_APP_ROLER = "wapapp_roler";

	public static final String TABLE_WAP_APP_ROLERMOUDLE = "wapapp_rolermoudle";

	public static final String TABLE_WAP_APP_ROLERUSER = "wapapp_roleruser";

	public static final String TABLE_EDI_SYSTEMP = "_EdiSysTemp_";

	public static final String TABLE_APP_WFTAG = "app_wftag";

	public static final String TABLE_APP_WFTAGMAP = "app_tagmap";

	public static final String TABLE_APP_WFMOUDLE = "app_wfmoudle";

	public static final String TABLE_APP_WFINSTANCE = "app_wfinstance";

	public static final String TABLE_APP_WFOWNER = "app_wfowner";

	public static final String TABLE_APP_WFINSTANCEUSER = "app_wfinstanceowner";
	public static final String TABLE_APP_WFNOTIFY = "app_wfnotify"; //工作流回复提醒表
	public static final String TABLE_EDI_ACCESSORY = "edi_accessory"; //附件表

	public static final String TABLE_EDI_MSN_SEND = "edi_msn_send"; //短信发送表
	public static final String TABLE_EDI_MSN_SEND_BAK = "edi_msn_send_bak"; //短信发送表 备份

	public static final String TABLE_EDI_TLOGIN = "edi_t_login"; //门户登录表

	public static final String TABLE_EDI_MODULEROLER = "edi_moduleroler";
	public static final String TABLE_EDI_MODULEROLER_USER = "edi_moduleroler_user";
	public static final String TABLE_EDI_DESKTOPMODULE_ROLE = "edi_desktopmodule_role";

	/**
	 * 获得表edidbdes实体
	 * 
	 * @return
	 */
	public static TableEntity getTable_edidbdes() {
		TableEntity edi_bddes = new TableEntity(EdiDb.TABLE_EDI_BDDES);
		FieldEntity id = new FieldEntity();
		id.setFieldName("id");
		id.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		id.setSize(50);
		id.setIdentify(true);
		edi_bddes.addField(id);

		FieldEntity tableName = new FieldEntity();
		tableName.setFieldName("tableName");
		tableName.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		tableName.setSize(50);
		edi_bddes.addField(tableName);

		FieldEntity caption = new FieldEntity();
		caption.setFieldName("caption");
		caption.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		caption.setSize(50);
		edi_bddes.addField(caption);

		FieldEntity appId = new FieldEntity();
		appId.setFieldName("appId");
		appId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		appId.setSize(50);
		edi_bddes.addField(appId);

		return edi_bddes;
	}

	/**
	 * 产生表结构描述表，用于存储基础资料的描述
	 * 
	 * @return
	 */
	public static TableEntity getTable_describe() {
		TableEntity describe = new TableEntity(EdiDb.TABLE_EDI_TBDESCRIBE);
		FieldEntity id = new FieldEntity();
		id.setFieldName("id");
		id.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		id.setSize(50);
		id.setIdentify(true);
		describe.addField(id);

		FieldEntity appId = new FieldEntity();
		appId.setFieldName("appid");
		appId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		appId.setSize(50);
		describe.addField(appId);

		FieldEntity table = new FieldEntity();
		table.setFieldName("tablename");
		table.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		table.setSize(50);
		describe.addField(table);

		FieldEntity field = new FieldEntity();
		field.setFieldName("field");
		field.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		field.setSize(50);
		describe.addField(field);

		FieldEntity caption = new FieldEntity();
		caption.setFieldName("caption");
		caption.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		caption.setSize(50);
		describe.addField(caption);

		FieldEntity fieldType = new FieldEntity();
		fieldType.setFieldName("fieldtype");
		fieldType.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		fieldType.setSize(50);
		describe.addField(fieldType);

		FieldEntity sourceTable = new FieldEntity();
		sourceTable.setFieldName("sourcetable");
		sourceTable.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		sourceTable.setSize(50);
		describe.addField(sourceTable);

		FieldEntity remoteService = new FieldEntity();
		remoteService.setFieldName("remoteservice");
		remoteService.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		remoteService.setSize(50);
		describe.addField(remoteService);

		FieldEntity displayfield = new FieldEntity();
		displayfield.setFieldName("displayfield");
		displayfield.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		displayfield.setSize(50);
		describe.addField(displayfield);

		FieldEntity saveField = new FieldEntity();
		saveField.setFieldName("savefield");
		saveField.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		saveField.setSize(50);
		describe.addField(saveField);

		FieldEntity componentId = new FieldEntity();
		componentId.setFieldName("componentid");
		componentId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		componentId.setSize(50);
		describe.addField(componentId);

		FieldEntity primarykey = new FieldEntity();
		primarykey.setFieldName("primarykey");
		primarykey.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		primarykey.setSize(50);
		describe.addField(primarykey);
		return describe;
	}

	/**
	 * 获得表ediwfdes实体
	 * 
	 * @return
	 */
	public static TableEntity getTable_wfldes() {
		TableEntity edi_wfldes = new TableEntity(EdiDb.TABLE_EDI_WFLDES);
		edi_wfldes.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_wfldes.addField("appId", EdiDb.TYPE_STRING, 50);
		edi_wfldes.addField("caption", EdiDb.TYPE_STRING, 50);
		edi_wfldes.addField("designPageId", EdiDb.TYPE_STRING, 50);
		edi_wfldes.addField("designId", EdiDb.TYPE_STRING, 50);
		edi_wfldes.addField("workflow", EdiDb.TYPE_TEXT);

		return edi_wfldes;
	}

	/**
	 * 获得表实体editabledes
	 * 
	 * @return
	 */
	public static TableEntity getTable_editabledes() {
		TableEntity edi_tabledes = new TableEntity(EdiDb.TABLE_EDI_TABLEDES);
		FieldEntity id = new FieldEntity();
		id.setFieldName("id");
		id.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		id.setSize(50);
		id.setIdentify(true);
		edi_tabledes.addField(id);

		FieldEntity tableName = new FieldEntity();
		tableName.setFieldName("tableName");
		tableName.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		tableName.setSize(50);
		edi_tabledes.addField(tableName);

		FieldEntity appId = new FieldEntity();
		appId.setFieldName("appId");
		appId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		appId.setSize(50);
		edi_tabledes.addField(appId);

		FieldEntity partId = new FieldEntity();
		partId.setFieldName("partId");
		partId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		partId.setSize(50);
		edi_tabledes.addField(partId);

		FieldEntity valueDes = new FieldEntity();
		valueDes.setFieldName("valueDes");
		valueDes.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_TEXT));
		valueDes.setSize(50);
		edi_tabledes.addField(valueDes);

		return edi_tabledes;
	}

	/**
	 * 获得表ediservicedes实体
	 * 
	 * @return
	 */
	public static TableEntity getTable_ediservicedes() {
		TableEntity edi_bddes = new TableEntity(EdiDb.TABLE_EDI_SERVICEDES);
		FieldEntity id = new FieldEntity();
		id.setFieldName("id");
		id.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		id.setSize(50);
		id.setIdentify(true);
		edi_bddes.addField(id);

		FieldEntity caption = new FieldEntity();
		caption.setFieldName("caption");
		caption.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		caption.setSize(50);
		edi_bddes.addField(caption);

		FieldEntity appId = new FieldEntity();
		appId.setFieldName("appId");
		appId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		appId.setSize(50);
		edi_bddes.addField(appId);

		FieldEntity script = new FieldEntity();
		script.setFieldName("script");
		script.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_TEXT));
		script.setSize(50);
		edi_bddes.addField(script);

		FieldEntity isOpen = new FieldEntity();
		isOpen.setFieldName("isOpen");
		isOpen.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_BOOLEAN));
		isOpen.setSize(50);
		edi_bddes.addField(isOpen);

		FieldEntity des = new FieldEntity();
		des.setFieldName("tableName");
		des.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		des.setSize(255);
		edi_bddes.addField(des);

		return edi_bddes;
	}

	/**
	 * 获得表edipartdes实体
	 * 
	 * @return
	 */
	public static TableEntity getTable_edipartdes() {
		TableEntity edi_partdes = new TableEntity(EdiDb.TABLE_EDI_PARTDES);
		edi_partdes.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_partdes.addField("designid", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("appId", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("caption", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("ico", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("url", EdiDb.TYPE_STRING, 50);

		return edi_partdes;
	}

	/**
	 * 获得表edipagedes实体
	 * 
	 * @return
	 */
	public static TableEntity getTable_edipagedes() {
		TableEntity edi_pagedes = new TableEntity(EdiDb.TABLE_EDI_PAGEDES);
		FieldEntity id = new FieldEntity();
		id.setFieldName("id");
		id.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		id.setSize(50);
		id.setIdentify(true);
		edi_pagedes.addField(id);

		edi_pagedes.addField("designid", EdiDb.TYPE_STRING, 50);

		FieldEntity caption = new FieldEntity();
		caption.setFieldName("caption");
		caption.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		caption.setSize(50);
		edi_pagedes.addField(caption);

		FieldEntity appId = new FieldEntity();
		appId.setFieldName("appId");
		appId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		appId.setSize(50);
		edi_pagedes.addField(appId);

		FieldEntity partId = new FieldEntity();
		partId.setFieldName("partId");
		partId.setFieldType(SqlTypeHelper.getSqlType(EdiDb.TYPE_STRING));
		partId.setSize(50);
		edi_pagedes.addField(partId);

		return edi_pagedes;
	}

	/**
	 * 获得表ediappdes实体
	 * 
	 * @return
	 */
	public static TableEntity getTable_ediappdes() {
		TableEntity edi_partdes = new TableEntity(EdiDb.TABLE_EDI_APPDES);
		edi_partdes.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_partdes.addField("appname", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("caption", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("ico", EdiDb.TYPE_STRING, 50);
		edi_partdes.addField("url", EdiDb.TYPE_STRING, 50);

		return edi_partdes;
	}

	/**
	 * 获取附件表
	 * 
	 * @return
	 */
	public static TableEntity getTable_ediaccessory() {
		TableEntity edi_accessory = new TableEntity(EdiDb.TABLE_EDI_ACCESSORY);
		edi_accessory.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_accessory.addField("refid", EdiDb.TYPE_STRING, 50);
		edi_accessory.addField("reftype", EdiDb.TYPE_STRING, 50);
		edi_accessory.addField("title", EdiDb.TYPE_STRING, 50);
		edi_accessory.addField("filename", EdiDb.TYPE_STRING, 200);
		edi_accessory.addField("fileurl", EdiDb.TYPE_STRING, 200);
		edi_accessory.addField("filesize", EdiDb.TYPE_INT, 4);
		edi_accessory.addField("personid", EdiDb.TYPE_STRING, 50);
		edi_accessory.addField("createdate", EdiDb.TYPE_DATE, 8);
		edi_accessory.addField("appName", EdiDb.TYPE_STRING, 50);

		return edi_accessory;
	}

	public static TableEntity getTable_edidesktopmodulerole() {
		TableEntity edi_desktopmodule_role = new TableEntity(
				EdiDb.TABLE_EDI_DESKTOPMODULE_ROLE);
		edi_desktopmodule_role.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_desktopmodule_role.addField("roleid", EdiDb.TYPE_STRING, 50);
		edi_desktopmodule_role.addField("moduleid", EdiDb.TYPE_STRING, 50);

		return edi_desktopmodule_role;
	}

	public static TableEntity getTable_ediModuleRoler() {
		TableEntity edi_moduleroler = new TableEntity(
				EdiDb.TABLE_EDI_MODULEROLER);
		edi_moduleroler.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_moduleroler.addField("caption", EdiDb.TYPE_STRING, 500);
		//		edi_moduleroler.addField("userid",EdiDb.TYPE_STRING, 50);

		return edi_moduleroler;
	}

	public static TableEntity getTable_ediModuleRolerUser() {
		TableEntity edi_moduleRolerUser = new TableEntity(
				EdiDb.TABLE_EDI_MODULEROLER_USER);
		edi_moduleRolerUser.addField("id", EdiDb.TYPE_STRING, true, 50);
		edi_moduleRolerUser.addField("roleid", EdiDb.TYPE_STRING, 50);
		edi_moduleRolerUser.addField("userid", EdiDb.TYPE_STRING, 50);

		return edi_moduleRolerUser;
	}

	public static TableEntity getTable_appmoudle() {
		TableEntity app_moudle = new TableEntity(EdiDb.TABLE_APP_MOUDLE);
		app_moudle.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_moudle.addField("appid", EdiDb.TYPE_STRING, 50);
		app_moudle.addField("caption", EdiDb.TYPE_STRING, 50);
		app_moudle.addField("sequence", EdiDb.TYPE_STRING, 50);
		app_moudle.addField("authflag", EdiDb.TYPE_BOOLEAN);
		app_moudle.addField("ico", EdiDb.TYPE_STRING, 255);
		app_moudle.addField("bigico", EdiDb.TYPE_STRING, 255);
		app_moudle.addField("parent", EdiDb.TYPE_STRING, 50);
		app_moudle.addField("url", EdiDb.TYPE_STRING, 255);

		return app_moudle;
	}

	public static TableEntity getTable_wapappmoudle() {
		TableEntity wapapp_moudle = new TableEntity(EdiDb.TABLE_WAP_APP_MOUDLE);
		wapapp_moudle.addField("id", EdiDb.TYPE_STRING, true, 50);
		wapapp_moudle.addField("appid", EdiDb.TYPE_STRING, 50);
		wapapp_moudle.addField("caption", EdiDb.TYPE_STRING, 50);
		wapapp_moudle.addField("sequence", EdiDb.TYPE_STRING, 50);
		wapapp_moudle.addField("authflag", EdiDb.TYPE_STRING, 50);
		wapapp_moudle.addField("ico", EdiDb.TYPE_STRING, 255);
		wapapp_moudle.addField("bigico", EdiDb.TYPE_STRING, 255);
		wapapp_moudle.addField("parent", EdiDb.TYPE_STRING, 50);
		wapapp_moudle.addField("url", EdiDb.TYPE_STRING, 50);

		return wapapp_moudle;
	}

	public static TableEntity getTable_wapapproler() {
		TableEntity wapapp_roler = new TableEntity(EdiDb.TABLE_WAP_APP_ROLER);
		wapapp_roler.addField("id", EdiDb.TYPE_STRING, true, 50);
		wapapp_roler.addField("appid", EdiDb.TYPE_STRING, 50);
		wapapp_roler.addField("des", EdiDb.TYPE_STRING, 500);
		wapapp_roler.addField("caption", EdiDb.TYPE_STRING, 50);

		return wapapp_roler;
	}

	public static TableEntity getTable_wapapprolermoudle() {
		TableEntity wapapp_rolermoudle = new TableEntity(
				EdiDb.TABLE_WAP_APP_ROLERMOUDLE);
		wapapp_rolermoudle.addField("id", EdiDb.TYPE_STRING, true, 50);
		wapapp_rolermoudle.addField("appid", EdiDb.TYPE_STRING, 50);
		wapapp_rolermoudle.addField("moudleid", EdiDb.TYPE_STRING, 50);
		wapapp_rolermoudle.addField("rolerid", EdiDb.TYPE_STRING, 50);
		wapapp_rolermoudle.addField("appdesignid", EdiDb.TYPE_STRING, 50);

		return wapapp_rolermoudle;
	}

	public static TableEntity getTable_wapapproleruser() {
		TableEntity wapapp_roleruser = new TableEntity(
				EdiDb.TABLE_WAP_APP_ROLERUSER);
		wapapp_roleruser.addField("id", EdiDb.TYPE_STRING, true, 50);
		wapapp_roleruser.addField("appid", EdiDb.TYPE_STRING, 50);
		wapapp_roleruser.addField("rolerid", EdiDb.TYPE_STRING, 50);
		wapapp_roleruser.addField("userid", EdiDb.TYPE_STRING, 50);
		wapapp_roleruser.addField("appdesignid", EdiDb.TYPE_STRING, 50);

		return wapapp_roleruser;
	}

	public static TableEntity getTable_approler() {
		TableEntity app_roler = new TableEntity(EdiDb.TABLE_APP_ROLER);
		app_roler.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_roler.addField("appid", EdiDb.TYPE_STRING, 50);
		app_roler.addField("caption", EdiDb.TYPE_STRING, 255);
		app_roler.addField("des", EdiDb.TYPE_STRING, 500);
		return app_roler;
	}

	public static TableEntity getTable_approlermoudle() {
		TableEntity app_rolermoudle = new TableEntity(
				EdiDb.TABLE_APP_ROLERMOUDLE);
		app_rolermoudle.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_rolermoudle.addField("appid", EdiDb.TYPE_STRING, 50);
		app_rolermoudle.addField("rolerid", EdiDb.TYPE_STRING, 50);
		app_rolermoudle.addField("appdesignid", EdiDb.TYPE_STRING, 50);
		app_rolermoudle.addField("moudleid", EdiDb.TYPE_STRING, 50);
		return app_rolermoudle;
	}

	public static TableEntity getTable_approleruser() {
		TableEntity app_roleruser = new TableEntity(EdiDb.TABLE_APP_ROLERUSER);
		app_roleruser.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_roleruser.addField("rolerid", EdiDb.TYPE_STRING, 50);
		app_roleruser.addField("appid", EdiDb.TYPE_STRING, 50);
		app_roleruser.addField("appdesignid", EdiDb.TYPE_STRING, 50);
		app_roleruser.addField("userid", EdiDb.TYPE_STRING, 50);
		return app_roleruser;

	}

	public static TableEntity getTable_appwftag() {
		TableEntity app_wftag = new TableEntity(EdiDb.TABLE_APP_WFTAG);
		app_wftag.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_wftag.addField("appid", EdiDb.TYPE_STRING, 50);
		app_wftag.addField("caption", EdiDb.TYPE_STRING, 50);
		app_wftag.addField("memo", EdiDb.TYPE_STRING, 500);
		app_wftag.addField("tagdes", EdiDb.TYPE_TEXT);

		return app_wftag;
	}

	public static TableEntity getTable_apptagmap() {
		TableEntity app_tagmap = new TableEntity(EdiDb.TABLE_APP_WFTAGMAP);
		app_tagmap.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_tagmap.addField("appid", EdiDb.TYPE_STRING, 50);
		app_tagmap.addField("caption", EdiDb.TYPE_STRING, 50);
		app_tagmap.addField("wftagid", EdiDb.TYPE_STRING, 50);
		app_tagmap.addField("tagmapdes", EdiDb.TYPE_TEXT);

		return app_tagmap;
	}

	public static TableEntity getTable_appwfmoudle() {
		TableEntity app_wfmoudle = new TableEntity(EdiDb.TABLE_APP_WFMOUDLE);
		app_wfmoudle.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_wfmoudle.addField("appid", EdiDb.TYPE_STRING, 50);
		app_wfmoudle.addField("caption", EdiDb.TYPE_STRING, 50);
		app_wfmoudle.addField("wfxml", EdiDb.TYPE_TEXT);
		app_wfmoudle.addField("isused", EdiDb.TYPE_BOOLEAN);
		;
		app_wfmoudle.addField("wfldesId", EdiDb.TYPE_STRING, 50);
		app_wfmoudle.addField("pageurl", EdiDb.TYPE_STRING, 500);
		app_wfmoudle.addField("isdel", EdiDb.TYPE_BOOLEAN);

		return app_wfmoudle;
	}

	public static TableEntity getTable_appwfinstance() {
		TableEntity app_wfinstance = new TableEntity(EdiDb.TABLE_APP_WFINSTANCE);
		app_wfinstance.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_wfinstance.addField("appid", EdiDb.TYPE_STRING, 50);
		app_wfinstance.addField("wfxml", EdiDb.TYPE_TEXT);
		app_wfinstance.addField("isover", EdiDb.TYPE_BOOLEAN);
		app_wfinstance.addField("isbreak", EdiDb.TYPE_BOOLEAN);
		app_wfinstance.addField("isdel", EdiDb.TYPE_BOOLEAN);
		app_wfinstance.addField("content", EdiDb.TYPE_TEXT);
		app_wfinstance.addField("isrun", EdiDb.TYPE_BOOLEAN);
		app_wfinstance.addField("currnodeid", EdiDb.TYPE_STRING, 50);
		app_wfinstance.addField("wfname", EdiDb.TYPE_STRING, 500);
		app_wfinstance.addField("createrid", EdiDb.TYPE_STRING, 50);
		app_wfinstance.addField("createdate", EdiDb.TYPE_DATE, 50);
		app_wfinstance.addField("moudleid", EdiDb.TYPE_STRING, 50);
		app_wfinstance.addField("forminstanceid", EdiDb.TYPE_STRING, 50);
		app_wfinstance.addField("lastnodeid", EdiDb.TYPE_STRING, 50);

		return app_wfinstance;
	}

	public static TableEntity getTable_appwfowner() {
		TableEntity app_wfowner = new TableEntity(EdiDb.TABLE_APP_WFOWNER);
		app_wfowner.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_wfowner.addField("appid", EdiDb.TYPE_STRING, 50);
		app_wfowner.addField("wfmoudleid", EdiDb.TYPE_STRING, 50);
		app_wfowner.addField("userid", EdiDb.TYPE_STRING, 50);
		return app_wfowner;
	}

	public static TableEntity getTable_appwfinstanceuser() {
		TableEntity app_wfinstanceuser = new TableEntity(
				EdiDb.TABLE_APP_WFINSTANCEUSER);
		app_wfinstanceuser.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_wfinstanceuser.addField("userid", EdiDb.TYPE_STRING, 50);
		app_wfinstanceuser.addField("wfid", EdiDb.TYPE_STRING, 50);
		app_wfinstanceuser.addField("nodeid", EdiDb.TYPE_STRING, 50);
		app_wfinstanceuser.addField("nodestatus", EdiDb.TYPE_INT);
		app_wfinstanceuser.addField("hasanswer", EdiDb.TYPE_BOOLEAN);
		app_wfinstanceuser.addField("answercontent", EdiDb.TYPE_STRING, 4000);
		app_wfinstanceuser.addField("answerbrief", EdiDb.TYPE_STRING, 50);
		app_wfinstanceuser.addField("answeragree", EdiDb.TYPE_BOOLEAN);
		app_wfinstanceuser.addField("answerdate", EdiDb.TYPE_DATE);
		app_wfinstanceuser.addField("noderight", EdiDb.TYPE_INT);
		app_wfinstanceuser.addField("receivedate", EdiDb.TYPE_DATE);
		app_wfinstanceuser.addField("answerlimitdate", EdiDb.TYPE_DATE);
		app_wfinstanceuser.addField("answertype", EdiDb.TYPE_INT);
		app_wfinstanceuser.addField("attention", EdiDb.TYPE_BOOLEAN);
		app_wfinstanceuser.addField("forwardword", EdiDb.TYPE_STRING, 2000);
		app_wfinstanceuser.addField("forwarduserid", EdiDb.TYPE_STRING, 50);
		app_wfinstanceuser.addField("isfinished", EdiDb.TYPE_BOOLEAN);
		app_wfinstanceuser.addField("authorizeuserid", EdiDb.TYPE_STRING);
		app_wfinstanceuser.addField("authorizereason", EdiDb.TYPE_STRING);
		app_wfinstanceuser.addField("nodepersonindex", EdiDb.TYPE_INT);
		return app_wfinstanceuser;
	}

	public static TableEntity getTable_appwfnotify() {
		TableEntity app_wfnotify = new TableEntity(EdiDb.TABLE_APP_WFNOTIFY);
		app_wfnotify.addField("id", EdiDb.TYPE_STRING, true, 50);
		app_wfnotify.addField("appid", EdiDb.TYPE_STRING, 50);
		app_wfnotify.addField("wfid", EdiDb.TYPE_STRING, 50);
		app_wfnotify.addField("userid", EdiDb.TYPE_STRING, 50);
		app_wfnotify.addField("senduserid", EdiDb.TYPE_STRING, 50);
		app_wfnotify.addField("nodeid", EdiDb.TYPE_STRING, 50);
		app_wfnotify.addField("receivedate", EdiDb.TYPE_DATE);
		app_wfnotify.addField("isdel", EdiDb.TYPE_BOOLEAN);
		return app_wfnotify;
	}

	public static TableEntity getTable_personshortcut() {
		TableEntity person_shortcut = new TableEntity(
				EdiDb.TABLE_PERSON_SHORTCUT);
		person_shortcut.addField("id", EdiDb.TYPE_STRING, true, 50);
		person_shortcut.addField("userid", EdiDb.TYPE_STRING, 50);
		person_shortcut.addField("type", EdiDb.TYPE_INT);
		person_shortcut.addField("caption", EdiDb.TYPE_STRING);
		person_shortcut.addField("url", EdiDb.TYPE_STRING);
		person_shortcut.addField("icourl", EdiDb.TYPE_STRING);
		return person_shortcut;
	}

	public static TableEntity getTable_edi_desktop_module() {
		TableEntity desktop_module = new TableEntity(
				EdiDb.TABLE_EDI_DESKTOP_MODULE);
		desktop_module.addField("id", EdiDb.TYPE_STRING, true, 50);
		desktop_module.addField("name", EdiDb.TYPE_STRING, 50);
		desktop_module.addField("caption", EdiDb.TYPE_STRING, 50);
		desktop_module.addField("active", EdiDb.TYPE_BOOLEAN);
		desktop_module.addField("appname", EdiDb.TYPE_STRING);
		desktop_module.addField("servicename", EdiDb.TYPE_STRING);
		desktop_module.addField("url", EdiDb.TYPE_STRING, 500);
		desktop_module.addField("moreurl", EdiDb.TYPE_STRING, 500);
		return desktop_module;
	}

	public static TableEntity getTable_edi_desktop_style() {
		TableEntity desktop_style = new TableEntity(
				EdiDb.TABLE_EDI_DESKTOP_STYLE);
		desktop_style.addField("id", EdiDb.TYPE_STRING, true, 50);
		desktop_style.addField("userid", EdiDb.TYPE_STRING, 50);
		desktop_style.addField("pic", EdiDb.TYPE_STRING);
		desktop_style.addField("style", EdiDb.TYPE_STRING, 50);
		return desktop_style;
	}

	public static TableEntity getTable_edi_user() {
		TableEntity user = new TableEntity(EdiDb.TABLE_EDI_USER);
		user.addField("id", EdiDb.TYPE_STRING, true, 50);
		user.addField("account", EdiDb.TYPE_STRING, 50);
		user.addField("password", EdiDb.TYPE_STRING);
		user.addField("nickname", EdiDb.TYPE_STRING, 50);
		user.addField("officephone", EdiDb.TYPE_STRING, 50);
		user.addField("homephone", EdiDb.TYPE_STRING, 50);
		user.addField("mobile", EdiDb.TYPE_STRING, 50);
		user.addField("code", EdiDb.TYPE_STRING, 50);
		user.addField("weathercity", EdiDb.TYPE_STRING, 50);
		user.addField("isused", EdiDb.TYPE_BOOLEAN);
		return user;
	}

	public static TableEntity getTable_edi_unit() {
		TableEntity unit = new TableEntity(EdiDb.TABLE_EDI_UNIT);
		unit.addField("id", EdiDb.TYPE_STRING, true, 50);
		unit.addField("code", EdiDb.TYPE_STRING, 50);
		unit.addField("unitname", EdiDb.TYPE_STRING);
		unit.addField("parentid", EdiDb.TYPE_STRING, 50);
		unit.addField("isused", EdiDb.TYPE_BOOLEAN);
		unit.addField("showupperid", EdiDb.TYPE_STRING, 50);
		unit.addField("managerid", EdiDb.TYPE_STRING, 50);
		return unit;
	}

	public static TableEntity getTable_edi_unituser() {
		TableEntity unituser = new TableEntity(EdiDb.TABLE_EDI_UNITUSER);
		unituser.addField("id", EdiDb.TYPE_STRING, true, 50);
		unituser.addField("userid", EdiDb.TYPE_STRING, 50);
		unituser.addField("unitid", EdiDb.TYPE_STRING);
		//		unituser.addField("startdate",EdiDb.TYPE_DATE);
		//		unituser.addField("enddate",EdiDb.TYPE_DATE); 
		unituser.addField("code", EdiDb.TYPE_STRING, 50);
		return unituser;
	}

	public static TableEntity getTable_edi_roler() {
		TableEntity ediroler = new TableEntity(EdiDb.TABLE_EDI_ROLER);
		ediroler.addField("id", EdiDb.TYPE_STRING, true, 50);
		ediroler.addField("caption", EdiDb.TYPE_STRING);
		return ediroler;
	}

	public static TableEntity getTable_edi_rolerapp() {
		TableEntity rolerapp = new TableEntity(EdiDb.TABLE_EDI_ROLERAPP);
		rolerapp.addField("id", EdiDb.TYPE_STRING, true, 50);
		rolerapp.addField("rolerid", EdiDb.TYPE_STRING);
		rolerapp.addField("rolerappid", EdiDb.TYPE_STRING);
		return rolerapp;
	}

	public static TableEntity getTable_edi_roleruser() {
		TableEntity roleruser = new TableEntity(EdiDb.TABLE_EDI_ROLERUSER);
		roleruser.addField("id", EdiDb.TYPE_STRING, true, 50);
		roleruser.addField("rolerid", EdiDb.TYPE_STRING);
		roleruser.addField("userid", EdiDb.TYPE_STRING);
		return roleruser;
	}

	public static TableEntity getTable_rolerapp() {
		TableEntity rolerapp = new TableEntity(EdiDb.TABLE_ROLERAPP);
		rolerapp.addField("id", EdiDb.TYPE_STRING, true, 50);
		rolerapp.addField("caption", EdiDb.TYPE_STRING);
		rolerapp.addField("ico", EdiDb.TYPE_STRING);
		rolerapp.addField("url", EdiDb.TYPE_STRING);
		return rolerapp;
	}

	public static TableEntity getTable_EDI_NetHdUserCapacity() {
		TableEntity userCapacity = new TableEntity(
				EdiDb.TABLE_EDI_NETHdUSERCAPACITY);
		userCapacity.addField("uuid", EdiDb.TYPE_STRING);
		userCapacity.addField("userid", EdiDb.TYPE_STRING);
		userCapacity.addField("capacity", EdiDb.TYPE_INT);
		return userCapacity;
	}

	public static TableEntity getTable_EDI_NETHdFILES() {
		TableEntity userCapacity = new TableEntity(EdiDb.TABLE_EDI_NETHdFILES);
		userCapacity.addField("uuid", EdiDb.TYPE_STRING);
		userCapacity.addField("filePath", EdiDb.TYPE_STRING, 500);
		userCapacity.addField("share", EdiDb.TYPE_STRING, 4000);
		userCapacity.addField("userId", EdiDb.TYPE_STRING);
		userCapacity.addField("type", EdiDb.TYPE_STRING);
		return userCapacity;
	}

	public static TableEntity getTable_EDI_MSNSEND() {
		TableEntity msn = new TableEntity(EdiDb.TABLE_EDI_MSN_SEND);
		msn.addField("content", EdiDb.TYPE_STRING, 4000);
		msn.addField("mobile", EdiDb.TYPE_STRING);
		msn.addField("issuedate", EdiDb.TYPE_DATE);
		msn.addField("personid", EdiDb.TYPE_STRING);
		msn.addField("recieverid", EdiDb.TYPE_STRING);
		return msn;
	}

	public static TableEntity getTable_EDI_MSNSEND_BAK() {
		TableEntity msnbak = new TableEntity(EdiDb.TABLE_EDI_MSN_SEND_BAK);
		msnbak.addField("content", EdiDb.TYPE_STRING, 4000);
		msnbak.addField("mobile", EdiDb.TYPE_STRING);
		msnbak.addField("issuedate", EdiDb.TYPE_DATE);
		msnbak.addField("personid", EdiDb.TYPE_STRING);
		msnbak.addField("recieverid", EdiDb.TYPE_STRING);
		return msnbak;
	}

	public static TableEntity getTable_TABLE_EDI_TLOGIN() {
		TableEntity tlogin = new TableEntity(EdiDb.TABLE_EDI_TLOGIN);
		tlogin.addField("fuserid", EdiDb.TYPE_STRING);
		tlogin.addField("fsystemid", EdiDb.TYPE_INT);
		tlogin.addField("fusername", EdiDb.TYPE_DATE);
		tlogin.addField("fuserpass", EdiDb.TYPE_STRING);
		return tlogin;
	}

}
